home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / UTILITIE / CPU_MEMO / 3468.ZIP / POPUP.ZIP / POPUP.DOC < prev    next >
Text File  |  1988-06-30  |  3KB  |  103 lines

  1. ==============================================================
  2. Documentation for the POPUP function, and associated utilities
  3. ==============================================================
  4.  
  5. All programs in POPUP.ARC assume Microsoft C 4.0 and later, and
  6. MASM version 5.0 and later (although MASM 4.0 can be used with little
  7. modification of sources).
  8.  
  9. The popup.arc file contains the following files:
  10.  
  11. 1) clink.inc
  12.  
  13.    This contains a set of MASM macros for interfacing C and Assembler
  14.    programs. It assumes MASM 5.0, but comments are included in the file
  15.    for using MASM 4.0
  16.  
  17. 2) getkey.asm
  18.  
  19.    Contains a keyboard function.
  20.  
  21. 3) getstr.c
  22.  
  23.    Contains code to read in a string using only the BIOS.
  24.  
  25. 4) keycodes.h
  26.  
  27.    Defines keycodes returned by the function in getkey.asm
  28.  
  29. 5) peek.asm
  30.  
  31.    Just contains a simple peek() routine.
  32.  
  33. 6) popup.asm
  34.  
  35.    Contains the code for the popup() function. See the documentation within
  36.    it for more details.
  37.  
  38. 7) screenio.asm
  39.  
  40.    Low level routines for writing directly to the screen RAM without flicker.
  41.  
  42. 8) standard.h
  43.  
  44.    A header file defining things like FOREVER etc.
  45.  
  46. 9) windows.c
  47.  
  48.    Code for handling (one-at-a-time) popup windows.
  49.  
  50. 10) adjalloc.c
  51.  
  52.     This is a stand-alone program to adjust the maximum allocation size of
  53.     a program in it's EXE header.
  54.  
  55.     Compile it with : CL /Ox adjalloc.c
  56.  
  57.     This program is useful for adjusting the max alloc size of popup
  58.     programs, because otherwise they gobble up heaps of memory.
  59.     Microsoft C looks at the maxalloc entry in the EXE header to determine
  60.     how much space to reserve for it in memory.
  61.     BE CAREFUL WITH THIS! Reducing the size too much causes crashes!
  62.     Run the program with no parameters for usage.
  63.     I use this in the makefiles for my popup programs.
  64.  
  65. 11) windtest.c
  66.  
  67.     An example program, demonstrating the POPUP routines.
  68.     To compile it and all the routines it needs:
  69.  
  70.     MASM /ml popup;
  71.     MASM /ml screenio;
  72.     MASM /ml getkey;
  73.     MASM /ml peek;
  74.     CL /Ox adjalloc.c
  75.     CL /Ox windtest.c windows.c getstr.c screenio getkey popup peek
  76.     ADJALLOC windtest 10
  77.  
  78.  
  79.     Run the program, and press CTRL-ESC to pop it up.
  80.     Type in a line of text, and press return.
  81.  
  82.  
  83.  
  84. Some final notes
  85. ================
  86.  
  87. 1) You can't malloc memory AFTER a program has popped up.
  88.    Malloc any memory before you call popup()
  89. 2) fopen() doesn't call malloc directly, but the first file access thereafter
  90.    will. Therefore, either use open() only, or call setvbuf() immediately
  91.    after opening the file.
  92.    (NOTE: In the 5.0 manual entry for setvbuf(), the word "not" is missing
  93.     from the line saying "The stream must refer to an open file which has
  94.     <<not!>> been read or written to since being opened"
  95. 3) You cannot do console I/O through DOS once popped up.
  96. 4) There may be other functions which cannot be used. Proceed with caution.
  97. 5) If you ARE using malloc, MAKE SURE that you reflect the total amount
  98.    malloced in the parameter to ADJALLOC if you are using it.
  99.    If you malloc 100 paragraphs, ADJALLOC at least 100 paragraphs.
  100.    I usually allow some extra, "just in case".
  101.  
  102.  
  103.